// import Vue from 'vue'
import router from './index.js'
// GOOD
//将导航守卫挂载到$router
const whileList =['/']
router.beforeEach((to, from, next) => {
    console.log("to:::"+to+ "from:::"+from);
    // if (to.name !== 'Login' && !isAuthenticated) next({ name: 'Login' })
    if(whileList.indexOf(to.path)!==-1){
        next()
    }
    else{
        const  token= window.sessionStorage.getItem('token')
        if (token) {
            next()
        }else {
            next('/')
        }
    }
})
